package com.efounder.message.socket;

import com.efounder.message.manager.JFMessageManager;

import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;

public class JFChannelFutureListener implements ChannelFutureListener{
	private String messageID;

	public JFChannelFutureListener(String messageID) {
		super();

		this.messageID = messageID;
	}

	@Override
	public void operationComplete(ChannelFuture future) throws Exception {
		if(future.isSuccess()) {
			JFMessageManager.getInstance().messageDeliver(messageID);
		}else {
			JFMessageManager.getInstance().messageDeliverFailure(messageID);
		}
	}

	public String getMessageID() {
		return messageID;
	}

	public void setMessageID(String messageID) {
		this.messageID = messageID;
	}

}
